/*=========================================================================

Program:   Virtual Surgery
Language:  C++
Date:      2009-9-1
Version:   0.1
Mail:		   nelfylee@gmail.com

Copyright (c) 2009 Nelfy Lee. All rights reserved.

=========================================================================*/
#ifndef _COMMON_H_
#define _COMMON_H_

#include "ToolBar.h"
#include "itkImage.h"
#include "itkRGBPixel.h"
#include "itkDataObject.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkImageToVTKImageFilter.h"


typedef itk::DataObject IObject;

typedef itk::RGBPixel<unsigned char>	RGBType;

typedef itk::Image<unsigned char, 2>	ImageUChar2D;
typedef itk::Image<unsigned char, 3>	ImageUChar3D;
typedef itk::Image<short, 2>			ImageShort2D;
typedef itk::Image<short, 3>			ImageShort3D;
typedef itk::Image<float, 2>			ImageFloat2D;
typedef itk::Image<float, 3>			ImageFloat3D;
typedef itk::Image<RGBType, 2>			RGBUChar2D;

typedef itk::ImageFileReader<ImageUChar2D> ImageReaderUChar2D;
typedef itk::ImageFileReader<ImageUChar3D> ImageReaderUChar3D;
typedef itk::ImageFileReader<ImageFloat2D> ImageReaderFloat2D;
typedef itk::ImageFileWriter<ImageUChar3D> ImageWriterUChar3D;

typedef itk::ImageToVTKImageFilter<ImageUChar2D> ConnectorI2VUChar2D;
typedef itk::ImageToVTKImageFilter<ImageUChar3D> ConnectorI2VUChar3D;
typedef itk::ImageToVTKImageFilter<ImageShort3D> ConnectorI2VShort3D;
typedef itk::ImageToVTKImageFilter<ImageFloat2D> ConnectorI2VFloat2D;

typedef itk::ImageFileReader<RGBUChar2D> RGBReaderUChar2D;

template <typename ITK_Exporter, typename VTK_Importer>
void ConnectPipelines(ITK_Exporter exporter, VTK_Importer* importer);

template <typename VTK_Exporter, typename ITK_Importer>
void ConnectPipelines(VTK_Exporter* exporter, ITK_Importer importer);

#ifndef USINGITKTIME
#define USINGITKTIME

#define TIMESTART(x)	 printf(x); itk::TimeProbe clock; clock.Start(); 
#define TIMESTOP(x) clock.Stop(); printf("(time: %.2fs)\n", clock.GetMeanTime());

#endif

//extern ToolBar* g_toolBar;
#endif


